<!doctype html><html lang=en-us dir=ltr><head><meta charset=UTF-8><meta name=viewport content="width=device-width,initial-scale=1"><meta name=description content="Github: https://github.com/argoproj
一、简介 # 目前Argo项目中有如下几个子项目：
argoproj Common project repo for all Argo Projects
gitops-engine Public Democratizing GitOps
argo-workflows Workflow engine for Kubernetes
argo-cd Declarative continuous deployment for Kubernetes.
argo-events Event-driven automation framework
argo-rollouts Progressive Delivery for Kubernetes
cd和rollouts一个是持续交付工具，一个是渐进式发布工具，与原子能力关系不大。 workflows和events一个是基于容器的任务编排工具，一个是事件驱动框架。都与本次原子能力相关。
这样，就可以设计出一个由新建扫描任务事件触发，实例化经过编排可实现扫描全流程的方案。
流程如下：![[book_architecture/content/docs/programmer/base/argo_events_workfows.png]]
sensor作用 # 使事件转发和处理松耦合 Trigger事件的参数化，比如根据事件内容动态生成 二、Argo Workflow编排 # name: flip-coin script: image: python:alpine3.6 command: [python] source: | import random result = &ldquo;heads&rdquo; if random.randint(0,1) == 0 else &ldquo;tails&rdquo; print(result)
name: heads container: image: alpine:3."><meta name=theme-color content="#FFFFFF"><meta name=color-scheme content="light dark"><meta property="og:title" content><meta property="og:description" content="Github: https://github.com/argoproj
一、简介 # 目前Argo项目中有如下几个子项目：
argoproj Common project repo for all Argo Projects
gitops-engine Public Democratizing GitOps
argo-workflows Workflow engine for Kubernetes
argo-cd Declarative continuous deployment for Kubernetes.
argo-events Event-driven automation framework
argo-rollouts Progressive Delivery for Kubernetes
cd和rollouts一个是持续交付工具，一个是渐进式发布工具，与原子能力关系不大。 workflows和events一个是基于容器的任务编排工具，一个是事件驱动框架。都与本次原子能力相关。
这样，就可以设计出一个由新建扫描任务事件触发，实例化经过编排可实现扫描全流程的方案。
流程如下：![[book_architecture/content/docs/programmer/base/argo_events_workfows.png]]
sensor作用 # 使事件转发和处理松耦合 Trigger事件的参数化，比如根据事件内容动态生成 二、Argo Workflow编排 # name: flip-coin script: image: python:alpine3.6 command: [python] source: | import random result = &ldquo;heads&rdquo; if random.randint(0,1) == 0 else &ldquo;tails&rdquo; print(result)
name: heads container: image: alpine:3."><meta property="og:type" content="article"><meta property="og:url" content="http://example.org/docs/programmer/base/argo-%E4%BD%BF%E7%94%A8%E8%AE%B0%E5%BD%95/"><meta property="article:section" content="docs"><title>Argo 使用记录 | Ian's Blog</title>
<link rel=manifest href=/manifest.json><link rel=icon href=/favicon.png type=image/x-icon><link rel=stylesheet href=/book.min.c58292d36b18b675680ab9baea2029204537b839ea72f258746ec0f32ce8d6c8.css integrity="sha256-xYKS02sYtnVoCrm66iApIEU3uDnqcvJYdG7A8yzo1sg=" crossorigin=anonymous><script defer src=/flexsearch.min.js></script><script defer src=/en.search.min.569e34257b6d9d9d98bef2eba3a64a9a25f6edeb684dcfd9d09d6515476ff4fa.js integrity="sha256-Vp40JXttnZ2YvvLro6ZKmiX27etoTc/Z0J1lFUdv9Po=" crossorigin=anonymous></script></head><body dir=ltr><input type=checkbox class="hidden toggle" id=menu-control>
<input type=checkbox class="hidden toggle" id=toc-control><main class="container flex"><aside class=book-menu><div class=book-menu-content><nav><h2 class=book-brand><a class="flex align-center" href=/><span>Ian's Blog</span></a></h2><div class=book-search><input type=text id=book-search-input placeholder=Search aria-label=Search maxlength=64 data-hotkeys=s/><div class="book-search-spinner hidden"></div><ul id=book-search-results></ul></div><ul><li class=book-section-flat><a href=/docs/programmer/>程序员笔记</a><ul><li><input type=checkbox id=section-52f633cba5cf47818d8ec01e928396f2 class=toggle checked>
<label for=section-52f633cba5cf47818d8ec01e928396f2 class="flex justify-between"><a role=button>Base</a></label><ul><li><a href=/docs/programmer/base/k8s-%E9%85%8D%E5%A5%97%E8%AF%B4%E6%98%8E/>k8s 配套说明</a></li><li><a href=/docs/programmer/base/k8s-%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/>k8s技术分享</a></li><li><a href=/docs/programmer/base/k8s%E5%B8%B8%E7%94%A8%E5%91%BD%E4%BB%A4%E5%92%8C%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6%E8%A7%A3%E6%9E%90/>k8s学习-常用命令和配置文件</a></li><li><a href=/docs/programmer/base/pypi/>PyPi</a></li><li><a href=/docs/programmer/base/tipsofweb/>Nginx高可用</a></li><li><a href=/docs/programmer/base/for_china/>各个软件换源</a></li><li><a href=/docs/programmer/base/tipsofdebugers/>tips Of Debuggers</a></li><li><a href=/docs/programmer/base/notesdjango/>Django的建站的(｡･･)ﾉﾞ</a></li><li><a href=/docs/programmer/base/tipsofvim/>tip Of vim</a></li><li><a href=/docs/programmer/base/editer/>编辑器使用</a></li><li><a href=/docs/programmer/base/noteoflinux/>Linux</a></li><li><a href=/docs/programmer/base/argo-workflow%E6%80%A7%E8%83%BD%E6%B5%8B%E8%AF%95%E5%92%8C%E4%BD%BF%E7%94%A8%E5%9C%BA%E6%99%AF%E5%88%86%E6%9E%90/>Argo Workflow性能测试和使用场景分析</a></li><li><a href=/docs/programmer/base/argo-%E4%BD%BF%E7%94%A8%E8%AE%B0%E5%BD%95/ class=active>Argo 使用记录</a></li><li><a href=/docs/programmer/base/kafka-%E5%AE%89%E8%A3%85%E5%92%8C%E4%BD%BF%E7%94%A8/>Kafka 安装和使用</a></li><li><a href=/docs/programmer/base/paramiko-%E4%BD%BF%E7%94%A8-sshsftp/>Paramiko 使用 Ssh&amp;sftp</a></li><li><a href=/docs/programmer/base/pytest-%E6%B5%8B%E8%AF%95/>Py Test 测试</a></li><li><a href=/docs/programmer/base/sonar-%E4%BB%A3%E7%A0%81%E9%9D%99%E6%80%81%E6%A3%80%E6%9F%A5/>Sonar 代码静态检查</a></li><li><a href=/docs/programmer/base/%E5%B0%8F%E5%91%BD%E4%BB%A4/>小命令</a></li><li><a href=/docs/programmer/base/tip_dgraph/>Dgraph</a></li><li><a href=/docs/programmer/base/noteoffmtdata/>数据格式笔记</a></li></ul></li><li><input type=checkbox id=section-de7bfad1d124522974cdf8addfbb23f2 class=toggle>
<label for=section-de7bfad1d124522974cdf8addfbb23f2 class="flex justify-between"><a role=button>Net</a></label><ul><li><a href=/docs/programmer/net/uwsgi-%E5%A4%84%E7%90%86%E8%AE%B0%E5%BD%95/>uwsgi 处理记录</a></li><li><a href=/docs/programmer/net/tipsofgrpc/>gRpc使用小记</a></li><li><a href=/docs/programmer/net/net/>网络(Computer Network)</a></li><li><a href=/docs/programmer/net/elk%E5%9C%A8k8s%E4%B8%8A%E7%9A%84%E9%83%A8%E7%BD%B2%E4%BD%BF%E7%94%A8%E7%A4%BA%E4%BE%8B/>Elk在k8s上的部署使用示例</a></li><li><a href=/docs/programmer/net/nginx%E5%AE%9E%E7%94%A8%E9%85%8D%E7%BD%AE/>Nginx实用配置</a></li></ul></li><li><input type=checkbox id=section-bf4e0d6f0b81f7b3ec08ed1fc66b874d class=toggle>
<label for=section-bf4e0d6f0b81f7b3ec08ed1fc66b874d class="flex justify-between"><a role=button>Langs</a></label><ul><li><a href=/docs/programmer/langs/cmake/>CMake 使用Tips</a></li><li><a href=/docs/programmer/langs/noteofgoexp/>Golang进阶笔记</a></li><li><a href=/docs/programmer/langs/noteofgolang/>Golang笔记</a></li><li><a href=/docs/programmer/langs/tipsofmarkdown/>tips Of markdown</a></li><li><a href=/docs/programmer/langs/notespython/>Python笔记(notes of Python)</a></li><li><a href=/docs/programmer/langs/notesjava/>愉快的Java(happy to learn the fuck java)</a></li></ul></li><li><input type=checkbox id=section-cd029da01a5cf373a5379dc078a74f2c class=toggle>
<label for=section-cd029da01a5cf373a5379dc078a74f2c class="flex justify-between"><a role=button>Game and Simulation</a></label><ul><li><a href=/docs/programmer/game_and_simulation/blender/>Blender</a></li><li><a href=/docs/programmer/game_and_simulation/noteofue4/>UE4 笔记</a></li></ul></li><li><input type=checkbox id=section-883e27361d38e16afb68faff3435ac0b class=toggle>
<label for=section-883e27361d38e16afb68faff3435ac0b class="flex justify-between"><a role=button>Ml</a></label><ul><li><a href=/docs/programmer/ml/tensorflow/>Tensorflow</a></li><li><a href=/docs/programmer/ml/opencv/>OpenCV</a></li><li><a href=/docs/programmer/ml/paddle/>Paddle</a></li><li><a href=/docs/programmer/ml/noteofmachinelearning/>机器学习库</a></li></ul></li><li><input type=checkbox id=section-7e5360c5e7954906b897ed79085884b6 class=toggle>
<label for=section-7e5360c5e7954906b897ed79085884b6 class="flex justify-between"><a href=/docs/programmer/gui/>Gui</a></label><ul><li><a href=/docs/programmer/gui/pyinstaller/>python打包</a></li><li><a href=/docs/programmer/gui/qt/>Qt/PySide</a></li><li><a href=/docs/programmer/gui/noteofvn_py/>Vn.Py学习笔记（Python交易平台框架）</a></li><li><a href=/docs/programmer/gui/notespython/>图形化界面 （Python Gui）</a></li></ul></li><li><input type=checkbox id=section-4446dd07527142b855f26d7cc8f0e617 class=toggle>
<label for=section-4446dd07527142b855f26d7cc8f0e617 class="flex justify-between"><a role=button>Database</a></label><ul><li><a href=/docs/programmer/database/dgraph/>Dgraph使用小记</a></li><li><a href=/docs/programmer/database/noteofdocker/>notes Of docker</a></li><li><a href=/docs/programmer/database/noteofdbdata/>db数据库</a></li><li><a href=/docs/programmer/database/mongodb/>Mongodb</a></li></ul></li><li><input type=checkbox id=section-d325c59fc6513e1b1e05a60b192d4973 class=toggle>
<label for=section-d325c59fc6513e1b1e05a60b192d4973 class="flex justify-between"><a href=/docs/programmer/hardware/>Hardware</a></label><ul><li><a href=/docs/programmer/hardware/android/>Android</a></li><li><a href=/docs/programmer/hardware/raspberrypi/>Raspberry Pi</a></li><li><a href=/docs/programmer/hardware/readme/>Readme</a></li><li><a href=/docs/programmer/hardware/screen/>Screen</a></li></ul></li><li><input type=checkbox id=section-40d35e91afa620ff2e7bf6291cfb3e1d class=toggle>
<label for=section-40d35e91afa620ff2e7bf6291cfb3e1d class="flex justify-between"><a href=/docs/programmer/software/>Software</a></label><ul><li><a href=/docs/programmer/software/bash/>Bash</a></li><li><a href=/docs/programmer/software/freebsd/>Freebsd</a></li><li><a href=/docs/programmer/software/gitbook/>Gitbook</a></li><li><a href=/docs/programmer/software/markdown/>Markdown</a></li><li><a href=/docs/programmer/software/npm/>Npm</a></li><li><a href=/docs/programmer/software/readme/>Readme</a></li><li><a href=/docs/programmer/software/vim/>Vim</a></li></ul></li><li><a href=/docs/programmer/install_some/>安装问题</a></li><li><a href=/docs/programmer/demo_test_some/>Demo Test项目中的一些东西</a></li><li><a href=/docs/programmer/tipsofproblems/>解决问题</a></li></ul></li><li class=book-section-flat><a href=/docs/example/>Hugo特殊Markdown语法说明</a><ul><li><a href=/docs/example/table-of-contents/>Table of Contents</a><ul><li><a href=/docs/example/table-of-contents/with-toc/>With ToC</a></li><li><a href=/docs/example/table-of-contents/without-toc/>Without ToC</a></li></ul></li><li class=book-section-flat><span>Shortcodes</span><ul><li><a href=/docs/example/shortcodes/buttons/>Buttons</a></li><li><a href=/docs/example/shortcodes/columns/>Columns</a></li><li><a href=/docs/example/shortcodes/details/>Details</a></li><li><a href=/docs/example/shortcodes/expand/>Expand</a></li><li><a href=/docs/example/shortcodes/hints/>Hints</a></li><li><input type=checkbox id=section-1c6a8516f710b6065a114907cef8489f class=toggle>
<label for=section-1c6a8516f710b6065a114907cef8489f class="flex justify-between"><a href=/docs/example/shortcodes/section/>Section</a></label><ul><li><a href=/docs/example/shortcodes/section/first-page/>First Page</a></li><li><a href=/docs/example/shortcodes/section/second-page/>Second Page</a></li></ul></li><li><a href=/docs/example/shortcodes/tabs/>Tabs</a></li></ul></li></ul></li></ul><ul><li><a href=/posts/>Blog</a></li></ul></nav><script>(function(){var e=document.querySelector("aside .book-menu-content");addEventListener("beforeunload",function(){localStorage.setItem("menu.scrollTop",e.scrollTop)}),e.scrollTop=localStorage.getItem("menu.scrollTop")})()</script></div></aside><div class=book-page><header class=book-header><div class="flex align-center justify-between"><label for=menu-control><img src=/svg/menu.svg class=book-icon alt=Menu>
</label><strong>Argo 使用记录</strong>
<label for=toc-control><img src=/svg/toc.svg class=book-icon alt="Table of Contents"></label></div><aside class="hidden clearfix"><nav id=TableOfContents><ul><li><a href=#一简介>一、简介</a><ul><li><a href=#sensor作用>sensor作用</a></li></ul></li><li><a href=#二argo-workflow编排>二、Argo Workflow编排</a></li><li><a href=#三argo-events使用>三、Argo Events使用</a><ul><li><a href=#需验证的问题>需验证的问题</a></li></ul></li><li><a href=#四部署>四、部署</a><ul><li><a href=#1-运维命令>1. 运维命令</a></li><li><a href=#2-安装和启动>2. 安装和启动</a></li></ul></li><li><a href=#etcd>ETCD</a></li><li><a href=#大量workflows优化建议>大量Workflows优化建议</a></li><li><a href=#创建时缺少安全上下文问题>创建时缺少安全上下文问题</a></li><li><a href=#修改执行器>修改执行器</a></li></ul></nav></aside></header><article class=markdown><p>Github: <a href=https://github.com/argoproj>https://github.com/argoproj</a></p><h2 id=一简介>一、简介
<a class=anchor href=#%e4%b8%80%e7%ae%80%e4%bb%8b>#</a></h2><p>目前Argo项目中有如下几个子项目：</p><ul><li><p><a href=https://github.com/argoproj/argopro>argoproj</a> <code>Common project repo for all Argo Projects</code></p></li><li><p><a href=https://github.com/argoproj/gitops-engine>gitops-engine</a> <code>Public Democratizing GitOps</code></p></li><li><p><a href=https://github.com/argoproj/argo-workflows>argo-workflows</a> <code>Workflow engine for Kubernetes</code></p></li><li><p><a href=https://github.com/argoproj/argo-cd>argo-cd</a> <code>Declarative continuous deployment for Kubernetes.</code></p></li><li><p><a href=https://github.com/argoproj/argo-events>argo-events</a> <code>Event-driven automation framework</code></p></li><li><p><a href=https://github.com/argoproj/argo-rollouts>argo-rollouts</a> <code>Progressive Delivery for Kubernetes</code></p></li></ul><p><code>cd</code>和<code>rollouts</code>一个是持续交付工具，一个是渐进式发布工具，与原子能力关系不大。
<code>workflows</code>和<code>events</code>一个是基于容器的任务编排工具，一个是事件驱动框架。都与本次原子能力相关。</p><p>这样，就可以设计出一个由新建扫描任务事件触发，实例化经过编排可实现扫描全流程的方案。</p><p><strong>流程如下：![[book_architecture/content/docs/programmer/base/argo_events_workfows.png]]</strong></p><h3 id=sensor作用>sensor作用
<a class=anchor href=#sensor%e4%bd%9c%e7%94%a8>#</a></h3><ul><li>使事件转发和处理松耦合</li><li>Trigger事件的参数化，比如根据事件内容动态生成</li></ul><h2 id=二argo-workflow编排>二、Argo Workflow编排
<a class=anchor href=#%e4%ba%8cargo-workflow%e7%bc%96%e6%8e%92>#</a></h2><ul><li><p>name: flip-coin
script:
image: python:alpine3.6
command: [python]
source: |
import random
result = &ldquo;heads&rdquo; if random.randint(0,1) == 0 else &ldquo;tails&rdquo;
print(result)</p></li><li><p>name: heads
container:
image: alpine:3.6
command: [sh, -c]
args: [&ldquo;echo "it was heads"&rdquo;]</p></li></ul><h2 id=三argo-events使用>三、Argo Events使用
<a class=anchor href=#%e4%b8%89argo-events%e4%bd%bf%e7%94%a8>#</a></h2><ol><li>定义一个webhook(名称: webhook_example)路径/webhook, 端口12000, 接收 POST 方法.</li></ol><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-yaml data-lang=yaml><span style=display:flex><span><span style=color:#f92672>apiVersion</span>: <span style=color:#ae81ff>argoproj.io/v1alpha1</span>
</span></span><span style=display:flex><span><span style=color:#f92672>kind</span>: <span style=color:#ae81ff>EventSource</span>
</span></span><span style=display:flex><span><span style=color:#f92672>metadata</span>:
</span></span><span style=display:flex><span>  <span style=color:#f92672>name</span>: <span style=color:#ae81ff>webhook</span>
</span></span><span style=display:flex><span><span style=color:#f92672>spec</span>:
</span></span><span style=display:flex><span>  <span style=color:#f92672>service</span>:
</span></span><span style=display:flex><span>    <span style=color:#f92672>ports</span>:
</span></span><span style=display:flex><span>      - <span style=color:#f92672>port</span>: <span style=color:#ae81ff>12000</span>
</span></span><span style=display:flex><span>        <span style=color:#f92672>targetPort</span>: <span style=color:#ae81ff>12000</span>
</span></span><span style=display:flex><span>  <span style=color:#f92672>webhook</span>:
</span></span><span style=display:flex><span>    <span style=color:#f92672>webhook_example</span>:
</span></span><span style=display:flex><span>      <span style=color:#f92672>port</span>: <span style=color:#e6db74>&#34;12000&#34;</span>
</span></span><span style=display:flex><span>      <span style=color:#f92672>endpoint</span>: <span style=color:#ae81ff>/webhook</span>
</span></span><span style=display:flex><span>      <span style=color:#f92672>method</span>: <span style=color:#ae81ff>POST</span>
</span></span></code></pre></div><ol start=2><li>定义<code>Sensor</code> 指定行为</li></ol><p>Yaml说明:
i. 定义了订阅的EventSource以及具体的Webhook(一个EventSource可以定义多个Webhook,因此指定俩参数)
ii. Trigger中定义了对应Action 创建一个werkflow, workflow的spec在respirce中配置
iii. parameters定义了workfolw的参数,从event中获取,如上将整个event都作为input(只获取body部分可通过: dataKey: body.message)
iv: 此时 <code>curl -X POST -d '{"message": "Hello"}' 127.0.0.1:12000/webhook</code>,可见argo workflow中创建了一个实例. 如传入整个请求,获得的数据可能经由base64编码的,需要解码后使用<code>{"context": "", "data": "包含header和body"}</code>
v: 其他用法查看: <a href=https://blog.51cto.com/u_15103028/2647114>这里</a></p><h3 id=需验证的问题>需验证的问题
<a class=anchor href=#%e9%9c%80%e9%aa%8c%e8%af%81%e7%9a%84%e9%97%ae%e9%a2%98>#</a></h3><ol><li>workflow并行处理多个不同参数的相同任务效率需要验证</li></ol><h2 id=四部署>四、部署
<a class=anchor href=#%e5%9b%9b%e9%83%a8%e7%bd%b2>#</a></h2><h3 id=1-运维命令>1. 运维命令
<a class=anchor href=#1-%e8%bf%90%e7%bb%b4%e5%91%bd%e4%bb%a4>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>argo submit hello-world.yaml    <span style=color:#75715e># submit a workflow spec to Kubernetes</span>
</span></span><span style=display:flex><span>argo list                       <span style=color:#75715e># list current workflows</span>
</span></span><span style=display:flex><span>argo get hello-world-xxx        <span style=color:#75715e># get info about a specific workflow</span>
</span></span><span style=display:flex><span>argo logs hello-world-xxx       <span style=color:#75715e># print the logs from a workflow</span>
</span></span><span style=display:flex><span>argo delete hello-world-xxx     <span style=color:#75715e># delete workflow</span>
</span></span></code></pre></div><h3 id=2-安装和启动>2. 安装和启动
<a class=anchor href=#2-%e5%ae%89%e8%a3%85%e5%92%8c%e5%90%af%e5%8a%a8>#</a></h3><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>kubectl create namespace argo
</span></span><span style=display:flex><span>kubectl apply -f https://raw.githubusercontent.com/argoproj/argo-workflows/master/manifests/quick-start-postgres.yaml <span style=color:#75715e># 最全-精简安装看别的</span>
</span></span><span style=display:flex><span><span style=color:#75715e># 查看运行状态</span>
</span></span><span style=display:flex><span>kubectl get pods -n argo
</span></span><span style=display:flex><span>kubectl get svc -n argo
</span></span><span style=display:flex><span><span style=color:#75715e># 将svc改为nodeport方便访问Web UI</span>
</span></span><span style=display:flex><span>kubectl edit svc -n argo argo-workflow-argo-workflows-server <span style=color:#75715e># 或者argo-server 名字会变但是差不多这意思 进去手动将ClusterIP改为NodePort</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#75715e># 查看argo server pod在哪个node上运行 端口映射到了node哪个端口</span>
</span></span><span style=display:flex><span>kubectl get pods -n argo -o wide
</span></span><span style=display:flex><span><span style=color:#75715e># 查看该node IP</span>
</span></span><span style=display:flex><span>kubectl get node -o wide
</span></span><span style=display:flex><span><span style=color:#75715e># http//nodeip:nodePort访问</span>
</span></span><span style=display:flex><span>
</span></span><span style=display:flex><span><span style=color:#75715e># 提交任务</span>
</span></span><span style=display:flex><span>argo submit https://github.com/argoproj/argo-workflows/blob/master/examples/coinflip.yaml --watch -n argo <span style=color:#75715e># 将yaml下载下载执行为佳</span>
</span></span></code></pre></div><h4 id=权限问题>权限问题
<a class=anchor href=#%e6%9d%83%e9%99%90%e9%97%ae%e9%a2%98>#</a></h4><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>User <span style=color:#e6db74>&#34;system:serviceaccount:argo:default&#34;</span> cannot patch resource <span style=color:#e6db74>&#34;pods&#34;</span> in API group <span style=color:#e6db74>&#34;&#34;</span> in the namespace <span style=color:#e6db74>&#34;argo&#34;</span>: RBAC: role.rbac.authorization.k8s.io <span style=color:#e6db74>&#34;argo-workflow&#34;</span> not found
</span></span></code></pre></div><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-bash data-lang=bash><span style=display:flex><span>Confusing, possibly erroneous RBAC warnings <span style=color:#f92672>(</span><span style=color:#e6db74>&#34;Failed to get pod&#34;</span><span style=color:#f92672>)</span>
</span></span></code></pre></div><p>可见: <a href=https://github.com/argoproj/argo-workflows/issues/2228>argo-workflows Issues</a></p><h2 id=etcd>ETCD
<a class=anchor href=#etcd>#</a></h2><blockquote><p>因为k8s状态都在etcd集群中，所以需要关注一下大量workflow会不会占用过多的容量资源</p></blockquote><div class=highlight><pre tabindex=0 style=color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-sh data-lang=sh><span style=display:flex><span>ETCDCTL_API<span style=color:#f92672>=</span><span style=color:#ae81ff>3</span> etcdctl --cacert /etc/kubernetes/pki/etcd/ca.crt --cert /etc/kubernetes/pki/etcd/healthcheck-client.crt --key /etc/kubernetes/pki/etcd/healthcheck-client.key  --write-out<span style=color:#f92672>=</span>table endpoint status
</span></span><span style=display:flex><span>+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
</span></span><span style=display:flex><span>|    ENDPOINT    |        ID        | VERSION | DB SIZE | IS LEADER | IS LEARNER | RAFT TERM | RAFT INDEX | RAFT APPLIED INDEX | ERRORS |
</span></span><span style=display:flex><span>+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
</span></span><span style=display:flex><span>| 127.0.0.1:2379 | 871f72e4ab5a28e8 |   3.5.0 |  <span style=color:#ae81ff>104</span> MB |      true |      false |        <span style=color:#ae81ff>35</span> |  <span style=color:#ae81ff>348058564</span> |          <span style=color:#ae81ff>348058564</span> |        |
</span></span><span style=display:flex><span>+----------------+------------------+---------+---------+-----------+------------+-----------+------------+--------------------+--------+
</span></span></code></pre></div><p>根据提供的信息，可以看到以下解释：</p><ul><li>ENDPOINT: etcd集群的地址为127.0.0.1:2379。</li><li>ID: etcd集群的唯一标识为871f72e4ab5a28e8。</li><li>VERSION: etcd的版本为3.5.0。</li><li>DB SIZE: etcd数据库当前占用的空间大小为104 MB。</li><li>IS LEADER: 当前节点是否为etcd集群的Leader节点，这里显示为true。</li><li>IS LEARNER: 当前节点是否为etcd集群的Learner节点，这里显示为false。</li><li>RAFT TERM: 当前etcd集群的Raft Term为35。</li><li>RAFT INDEX: 当前etcd集群的Raft Index为348058564。</li><li>RAFT APPLIED INDEX: 当前etcd集群已应用的Raft Index为348058564。</li><li>ERRORS: 没有显示任何错误信息。
总体上，这些信息展示了etcd集群的状态，包括节点角色、版本、数据库大小等。</li></ul><h2 id=大量workflows优化建议>大量Workflows优化建议
<a class=anchor href=#%e5%a4%a7%e9%87%8fworkflows%e4%bc%98%e5%8c%96%e5%bb%ba%e8%ae%ae>#</a></h2><blockquote><p>You have at least 230 completed workflows. Reducing the total number of workflows will reduce your costs.
Learn more at <a href=https://argoproj.github.io/argo-workflows/cost-optimisation/>https://argoproj.github.io/argo-workflows/cost-optimisation/</a></p></blockquote><h2 id=创建时缺少安全上下文问题>创建时缺少安全上下文问题
<a class=anchor href=#%e5%88%9b%e5%bb%ba%e6%97%b6%e7%bc%ba%e5%b0%91%e5%ae%89%e5%85%a8%e4%b8%8a%e4%b8%8b%e6%96%87%e9%97%ae%e9%a2%98>#</a></h2><blockquote><p>This workflow does not have security context set. You can run your workflow pods more securely by setting it.
Learn more at <a href=https://argoproj.github.io/argo-workflows/workflow-pod-security-context/>https://argoproj.github.io/argo-workflows/workflow-pod-security-context/</a></p></blockquote><h2 id=修改执行器>修改执行器
<a class=anchor href=#%e4%bf%ae%e6%94%b9%e6%89%a7%e8%a1%8c%e5%99%a8>#</a></h2></article><footer class=book-footer><div class="flex flex-wrap justify-between"></div><script>(function(){function e(e){const t=window.getSelection(),n=document.createRange();n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n)}document.querySelectorAll("pre code").forEach(t=>{t.addEventListener("click",function(){if(window.getSelection().toString())return;e(t.parentElement),navigator.clipboard&&navigator.clipboard.writeText(t.parentElement.textContent)})})})()</script></footer><div class=book-comments></div><label for=menu-control class="hidden book-menu-overlay"></label></div><aside class=book-toc><div class=book-toc-content><nav id=TableOfContents><ul><li><a href=#一简介>一、简介</a><ul><li><a href=#sensor作用>sensor作用</a></li></ul></li><li><a href=#二argo-workflow编排>二、Argo Workflow编排</a></li><li><a href=#三argo-events使用>三、Argo Events使用</a><ul><li><a href=#需验证的问题>需验证的问题</a></li></ul></li><li><a href=#四部署>四、部署</a><ul><li><a href=#1-运维命令>1. 运维命令</a></li><li><a href=#2-安装和启动>2. 安装和启动</a></li></ul></li><li><a href=#etcd>ETCD</a></li><li><a href=#大量workflows优化建议>大量Workflows优化建议</a></li><li><a href=#创建时缺少安全上下文问题>创建时缺少安全上下文问题</a></li><li><a href=#修改执行器>修改执行器</a></li></ul></nav></div></aside></main></body></html>